#include <QtGui/QApplication>
#include <QMessageBox>
#include <QFile>
#include <QDebug>
#include <QSqlQuery>
#include <QSplashScreen>
#include <QThread>
#include <QSettings>
#include "mainwindow.h"


class CxTestSleepThread : public QThread
{
public:
    /**
     *  this method is used to call sleep, as msleep is a protected function of
     *  QThread
     *
     *  @param nMSecs milliseconds to sleep
     */
    static void mySleep(int nMSecs)
    {
        msleep(nMSecs);
    }
};

int main(int argc, char *argv[]) {
    QApplication a(argc, argv);


    //asagidaki satir yerine resource calismiyor bu hata duzeltilecek.
    QPixmap pixmap("D:\\mycodes\\CPP\\Kutuphane\\pictures\\splash.png");
    QSplashScreen *splash = new QSplashScreen(pixmap);
    splash->show();
    a.processEvents();
    splash->showMessage("Loading modules...");
    CxTestSleepThread::mySleep(500);
    a.processEvents();
    splash->showMessage("Opening...");
    CxTestSleepThread::mySleep(500);
    MainWindow w;
    w.show();
    splash->finish(&w);
    delete splash;

    return a.exec();
}
